<%@page import="org.jeecgframework.web.util.StaticValue"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
	<div region="center" style="padding:1px;">
		<t:datagrid name="zyEquipmentChangeList" checkbox="true" fitColumns="false" title="巡检设备变更审批"  
			actionUrl="zyEquipmentChangeController.do?datagridOfApprovalOfHomePageTask&homePageType=${homePageType }" idField="id" fit="true" queryMode="group">
			<t:dgCol title="主键"  		field="id"  	hidden="true"	queryMode="single"	width="120" />
			<t:dgCol title="巡检单位"  	field="inspectionCompany"  	hidden="true"	queryMode="single" query="true"	width="90" dictionary="<%=StaticValue.DIC_INSPECTION_COMPANY %>" />
			<t:dgCol title="巡检设备变更申请ID"  	field="changeId"    		queryMode="single"	query="true" width="120"	 />
			<t:dgCol title="设备SN"  			field="equipmentSpareSn"	queryMode="single"	query="true" width="120" url="&sn={equipmentSpareSn}" funname="viewBySn"/>
			<t:dgCol title="影院名称"  			field="zyCinema.name"    	queryMode="single"	query="true" width="120"	 />
			<t:dgCol title="变更类型"  			field="changeType"    		queryMode="single"	query="true" width="120"	dictionary="<%=StaticValue.DIC_EQ_CHANGE_TYPE %>" />
			<t:dgCol title="变更原因"  			field="reqReasonVal" 		width="120" sortable="false" dictionary="<%=StaticValue.DIC_REQ_REASON %>" />
			<t:dgCol title="申请时间"  			field="requestTime" 		width="120"		formatter="yyyy-MM-dd" />
			<t:dgCol title="审批时间"  			field="approvalTime"		width="120"		formatter="yyyy-MM-dd" />
			<t:dgCol title="巡检计划ID"  		field="planId" 				width="120"		/>
			<t:dgCol title="审批状态"  			field="approvalState"    	width="120"	dictionary="<%=StaticValue.DIC_EQ_CHANGE_REQ_STATE %>" />
			<t:dgCol title="审批说明"  			field="approvalRemark"    	width="120" />
			
			<t:dgCol title="操作" 	field="opt" width="100"></t:dgCol>
			<t:dgOpenOpt url="zyEquipmentChangeController.do?goApproval&approvalFlag=true&id={id}" height="200" width="420" title="通过" openModel="OpenWin" exp="approvalState#eq#${states}"></t:dgOpenOpt>
			<t:dgOpenOpt url="zyEquipmentChangeController.do?goApproval&approvalFlag=false&id={id}" height="200" width="420" title="不通过" openModel="OpenWin" exp="approvalState#eq#${states}"></t:dgOpenOpt>
		</t:datagrid>
	</div>
</div>
<script type="text/javascript">
function viewBySn(title, param){
	$.ajax({
		url : "zyEquipmentSpareController.do?checkEsExistBySn" + param,
		cache : false,
		dataType : 'json',
		type : 'POST',
		success : function(data){
			if(data.success){
				addOneTab("查看设备详细","zyEquipmentSpareController.do?goView&id=" + data.obj,"");
			}else{
				tip(data.msg);
			}
		}
	});
}
</script>